<script src="<?php bloginfo('template_directory'); ?>/js/jquery-1.10.2.min.js" type="text/javascript"></script>
<?php get_header(); ?>
<div class="outer" id="contentwrap">
    <div id="content" class="home">
        <div class="contentleft"m>
            <div class="box1 box">
                <h1>TIN TỨC <b>CHUNG</b></h1>
                <?php
                global $post;
                $args = array('numberposts' => 1, 'category' => 2);
                $myposts = get_posts($args);
                foreach ($myposts as $post) :    setup_postdata($post);
                    ?>
                <div class="image-news">
                <a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>">
                    <?php if (has_post_thumbnail()) : ?>
                        <?php the_post_thumbnail(); ?>
                    <?php else: ?>
                        <img src="<?php echo catch_that_image() ?>" alt="<?php the_title(); ?>" width="251"
                             height="128"/>
                        </a>
                    <?php endif; ?>
                <?php endforeach; ?>
                </div>
                <div class="listitem">
                    <div class="item">
                        <h4>Gia đình</h4>
                        <?php
                        global $post;
                        $args = array('numberposts' => 1, 'category' => 2);
                        $myposts = get_posts($args);
                        foreach ($myposts as $post) :    setup_postdata($post);
                        ?>
                            <p><a href="<?php the_permalink(); ?>"><?php the_title(); ?> </a></p>
                        <?php endforeach; ?>

                    </div>
                    <div class="item">
                        <h4>Sự kiện</h4>
                        <?php
                        global $post;
                        $args = array('numberposts' => 1, 'category' => 20);
                        $myposts = get_posts($args);
                        foreach ($myposts as $post) :    setup_postdata($post);
                        ?>
                            <p><a href="<?php the_permalink(); ?>"><?php the_title(); ?> </a></p>
                        <?php endforeach; ?>
                    </div>
                    <div class="item">
                        <h4>Sức khỏe</h4>
                        <?php
                        global $post;
                        $args = array('numberposts' => 1, 'category' => 11);
                        $myposts = get_posts($args);
                        foreach ($myposts as $post) :    setup_postdata($post);
                            ?>
                            <p><a href="<?php the_permalink(); ?>"><?php the_title(); ?> </a></p>
                        <?php endforeach; ?>
                    </div>
                    <div class="item">
                        <h4>Đẹp365</h4>
                        <?php
                        global $post;
                        $args = array('numberposts' => 1, 'category' => 15);
                        $myposts = get_posts($args);
                        foreach ($myposts as $post) :    setup_postdata($post);
                        ?>
                            <p><a href="<?php the_permalink(); ?>"><?php the_title(); ?> </a></p>

                        <?php endforeach; ?>
                    </div>
                    <div class="item">
                        <h4>Xã hội</h4>
                        <?php
                        global $post;
                        $args = array('numberposts' => 1, 'category' => 9);
                        $myposts = get_posts($args);
                        foreach ($myposts as $post) :    setup_postdata($post);
                        ?>
                            <p><a href="<?php the_permalink(); ?>"><?php the_title(); ?> </a></p>

                        <?php endforeach; ?>
                    </div>
                    <div class="item">
                        <h4>Bác sĩ gia đình</h4>
                        <?php
                        global $post;
                        $args = array('numberposts' => 1, 'category' => 23);
                        $myposts = get_posts($args);
                        foreach ($myposts as $post) :    setup_postdata($post);
                        ?>
                            <p><a href="<?php the_permalink(); ?>"><?php the_title(); ?> </a></p>

                        <?php endforeach; ?>
                    </div>
                </div>
            </div>
            <div class="box2 box">
                <h1>góc làm đẹp <b>mẹ & bé</b></h1>
                <div class="listitem">

                    <?php
                    global $post;
                    $args = array( 'numberposts' => 6, 'category' => 15 );
                    $myposts = get_posts( $args );
                    foreach( $myposts as $post ) :	setup_postdata($post);
                        ?>
                        <div class="item">
                            <?php if ( has_post_thumbnail()) : ?>
                                <a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>" >
                                    <?php the_post_thumbnail('thumbnail', array('class' => 'alignleft')); ?>
                                </a>
                            <?php else:?>
                                <a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>" >
                                    <img src="<?php echo catch_that_image() ?>" alt="<?php the_title(); ?>"/>
                                </a>
                            <?php endif; ?>
                            <a href="<?php the_permalink(); ?>">
                                <?php  wp_strip_all_tags(the_title())?> </a>
                            <p><?php the_content_index()?></p>
                        </div>

                    <?php endforeach;?>
                </div>
                <div class="clr"></div>
            </div>
            <div class="box">
                <?php
                global $post;
                $args = array( 'numberposts' => 1, 'category' => 5 );
                $myposts = get_posts( $args );
                foreach( $myposts as $post ) :	setup_postdata($post);
                    ?>
                <div class="image-box">
                    <?php if ( has_post_thumbnail()) : ?>
                        <a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>" width="340" height="199" >
                            <?php the_post_thumbnail('thumbnail', array('class' => 'alignleft')); ?>
                        </a>
                    <?php else:?>
                        <a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>" >
                            <img src="<?php echo catch_that_image() ?>" alt="<?php the_title(); ?>" width="340" height="199"/>
                        </a>
                    <?php endif; ?>
                 </div>
                    <h1>góc của <b>mẹ</b></h1>
                    <p><?php the_content_index(); ?></p>
                <?php endforeach;?>
            </div>
            <div class="box">
                <?php
                global $post;
                $args = array( 'numberposts' => 1, 'category' => 3 );
                $myposts = get_posts( $args );
                foreach( $myposts as $post ) :	setup_postdata($post);
                    ?>
                <div class="image-box">
                    <?php if ( has_post_thumbnail()) : ?>
                        <a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>" >
                            <?php the_post_thumbnail('thumbnail', array('class' => 'alignleft')); ?>
                        </a>
                    <?php else:?>
                        <a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>" >
                            <img src="<?php echo catch_that_image() ?>" alt="<?php the_title(); ?>" width="340" height="199"/>
                        </a>
                    <?php endif; ?>
                    </div>
                    <h1>góc của <b>bé</b></h1>

                    <?php echo the_content_index(); ?>
                <?php endforeach;?>
            </div>
            <div class="box">
                <?php
                global $post;
                $args = array( 'numberposts' => 1, 'category' => 12 );
                $myposts = get_posts( $args );
                foreach( $myposts as $post ) :	setup_postdata($post);
                    ?>
                    <div class="image-box">
                    <?php if ( has_post_thumbnail()) : ?>
                        <a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>">
                            <?php the_post_thumbnail('medium', array('class' => 'alignleft')); ?>
                        </a>
                    <?php else:?>
                        <a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>" >
                            <img src="<?php echo catch_that_image() ?>" alt="<?php the_title(); ?>" width="340" height="199"/>
                        </a>
                    <?php endif; ?>
                    </div>
                    <h1>góc<b>Hài hước</b></h1>

                    <?php echo the_content_index(); ?>
                <?php endforeach;?>
            </div>
            <div class="box">
                <?php
                global $post;
                $args = array( 'numberposts' => 1, 'category' => 8 );
                $myposts = get_posts( $args );
                foreach( $myposts as $post ) :	setup_postdata($post);
                    ?>
                    <div class="image-box">
                    <?php if ( has_post_thumbnail()) : ?>
                        <a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>" >
                            <?php the_post_thumbnail('medium', array('class' => 'alignleft')); ?>
                        </a>
                    <?php else:?>
                        <a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>" >
                            <img src="<?php echo catch_that_image() ?>" alt="<?php the_title(); ?>" width="340" height="199"/>
                        </a>
                    <?php endif; ?>
                    </div>
                    <h1>góc <b>Tâm sự</b></h1>

                    <?php echo the_content_index(); ?>
                <?php endforeach;?>
            </div>

        </div>
        <!--End column left-->
        <?php get_sidebars('rightindex'); ?>

    </div>
</div>
<?php get_footer(); ?>
